package ubcns.lib.splash;

import ubcns.hk.R;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;

class SplashType{
	public static int Start = 1;
	public static int Finish = 2;
}


class SetSplash extends Handler {
	private Activity mActivity;
	private View mBackGround;
	
	public SetSplash(Activity act){
		mActivity = act;
		mBackGround = act.findViewById(R.id.backGround);
	}
	
	@Override
	public void dispatchMessage(Message msg) {
		
		
		Bundle dataSet = msg.getData();
		int splashType = dataSet.getInt("Logo");
		
		if(splashType == SplashType.Start){
			mBackGround.setBackgroundResource(R.drawable.com_logo);
		}
		else{
			mActivity.finish();
		}
		
		super.dispatchMessage(msg);
	}
}
